package com.hyt.it.ogt.kq.common.bm.enums;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;

/**
 * 报名流程
 * @Description:
 * @Author: STARF
 * @CreateDate: 2022/03/02 16:41
 **/
@Getter
public enum NodeTypeEnum {

    NONE("-1", "无效"),
    NOTICE("11", "报名须知"),
    BASEINFO("12", "基本信息"),
    SUBJECT("13", "报名科目"),
    VERIFY("14", "资格审核"),
    PAY("15", "缴费"),
    ADMISSION("16", "打印准考证");

    private String code;
    private String msg;


    NodeTypeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getTypeMsg(String code) {
        for (NodeTypeEnum type : NodeTypeEnum.values()) {
            if (code.equals(type.getCode())) {
                return type.msg;
            }
        }
        return null;
    }

    public static NodeTypeEnum getByCode(String code) {
        for (NodeTypeEnum nodeTypeEnum : NodeTypeEnum.values()) {
            if (StrUtil.equals(nodeTypeEnum.getCode(), code)) {
                return nodeTypeEnum;
            }
        }
        return NONE;
    }
}
